/*
 * @Author       : xh
 * @Date         : 2022-10-11 17:19:42
 * @LastEditors: y001554
 * @FileName     :
 */

import { demoBlockPlugin } from 'vitepress-theme-demoblock'
const sidebar = {
  '/plugins/': [
    { text: '快速开始', link: '/plugins/' },
    {
      text: '通用',
      children: [
        // { text: 'Button', link: '/plugins/button/' },
        { text: 'M-Tree', link: '/plugins/tree/' },
        { text: 'M-Select', link: '/plugins/select/' }
      ]
    },
    {
      text: '页面布局',
      children: [
        { text: 'M-Table', link: '/plugins/table/' },
        { text: 'M-Pages', link: '/plugins/pages/' },
        { text: 'M-Form', link: '/plugins/form/' },
        { text: 'M-Search', link: '/plugins/search/' },
        { text: 'M-Dialog', link: '/plugins/dialog/' }
      ]
    },
    {
      text: 'jSAPI',
      children: [{ text: 'MpDialog', link: '/plugins/mpDialog/' }]
    }
  ],
  '/utils/': [
    {
      text: '快速开始',
      link: '/utils/'
    },
    {
      text: '常用检验',
      link: '/utils/validate/'
    },
    {
      text: '常用工具',
      link: '/utils/tools/'
    },
    {
      text: 'CosUpload云存储',
      link: '/utils/cos/'
    }
  ]
}

const config = {
  title: 'M-plugins',
  themeConfig: {
    logo: '/logo.jpg',
    nav: [
      {
        text: 'welcome',
        link: '/'
      },
      {
        text: 'yl_plugins（V2）',
        link: 'http://loserjohn.gitee.io/yl_plugins/#/'
      },

      { text: 'blog', link: 'https://www.yuque.com/xiaoxiaohan-tal62/mbg5bk' },
      { text: 'gitee', link: 'https://gitee.com/loserjohn/ylwl.git' },
      { text: 'npm', link: 'https://www.npmjs.com/search?q=loserjohn' },
      {
        text: 'Library',
        items: [
          { text: 'Plugins', link: '/plugins/' },
          { text: 'Utils', link: '/utils/' }
        ]
      }
    ],
    sidebar
  },
  // 以下是新增的
  markdown: {
    config: (md) => {
      // 这里可以使用 markdown-it 插件，vitepress-theme-demoblock就是基于此开发的
      md.use(demoBlockPlugin)
    }
  },
  base: '/ylwl'
}

export default config
